<%@page import="com.mmy.domain.oa.LeaveInfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>  
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/WEB-INF/jsp/include1.jsp"></jsp:include>
		<title>请假记录</title>
		</head>
		<body>
			<div id="off-canvas-container" class="off-canvas-container">
				<jsp:include page="/WEB-INF/jsp/BackHeader.jsp"></jsp:include>
					<main class="at-padding-large-bottom">
					<article>		
			<header class="bg-light at-padding-large-top at-padding-large-bottom at-margin-large-bottom">
				<div class="page-header container">
					<h2>请假记录</h2>			
				</div>
			</header>
			<section class="container">
	

			<div>
				
				<a href="leaveinfo" >请假信息</a> |
				<a href="leavetype" >请假类型</a> 
				<hr style="FILTER: alpha(opacity=100,finishopacity=0,style=3); margin: 15px; " width=100%; color=#F9F6E5 SIZE=3></h>
				
				<form action="updateleaveinfo" class="info-form" >
						<h4 class="info-h4">
							<i class="fa fa-caret-right" aria-hidden="true" ></i>修改请假记录信息
						</h4>
				<div >
				
						<c:choose>
						     <c:when test="${leaveInfo.getFlag() == 0 && leaveInfo.getState() == 0}">
						          	 初次申请，等待审核后修改
						     </c:when>
						     <c:when test="${leaveInfo.getFlag() == 1 && leaveInfo.getState() == 2}">
						           	 二次申请，等待审核后修改
						     </c:when>
						     <c:when test="${leaveInfo.getFlag() == 3 && leaveInfo.getState() == 3}">
						          	 申请成功，无法修改
						     </c:when>
						     <c:when test="${leaveInfo.getFlag() == 2 && leaveInfo.getState() == 1}">
						           	 申请未通过，无法修改
						     </c:when>
			
						</c:choose>
			
				<table class="info-table" >
						
				<tr>
					<th>请假类型</th>
					<td >
						<input type="hidden" name="LeaveID"  value="${leaveInfo.getLeaveID()}" >
						<select class="input-select-vlign" name="TypeID" >
								<option style="display: none;">请选择</option>
							<c:forEach var="lo" items="${ltlist}">
								<option value="${lo.getTypeID()}">${lo.getTypeName()}</option>
							</c:forEach>	
						</select>
					</td>
					<th>请假理由</th>
					<td>
						<input type="text" name="Reason" value="${leaveInfo.getReason()}" maxlength="200" /><span class="mustWrite">*</span>
					</td>
				</tr>
				<tr>
					<th>备注</th>
					<td colspan="3">
						<textarea name="Memo" maxlength="256" >${leaveInfo.getMemo()}</textarea>
					</td>
				</tr>	
					
				</table>
				<center>
						<c:choose>
						     <c:when test="${leaveInfo.getFlag() == 0 && leaveInfo.getState() == 0}">
						          	<input type="button" class="btn" value="返回" onclick="rehidder()"/>
						     </c:when>
						     <c:when test="${leaveInfo.getFlag() == 1 && leaveInfo.getState() == 2}">
						           	 <input type="button" class="btn" value="返回" onclick="rehidder()"/>
						     </c:when>
						     <c:when test="${leaveInfo.getFlag() == 3 && leaveInfo.getState() == 3}">
						          	<input type="button" class="btn" value="返回" onclick="rehidder()"/>
						     </c:when>
						     <c:when test="${leaveInfo.getFlag() == 2 && leaveInfo.getState() == 1}">
						            <input type="button" class="btn" value="返回" onclick="rehidder()"/>
						     </c:when>
							 <c:otherwise>
						    	<input type="submit" class="btn" value="保存" />
								<input type="button" class="btn" value="返回" onclick="rehidder()"/>
						    </c:otherwise>
						</c:choose>
				
				</center> 
				</div>
				</form>
			</div>
			</section>
			</article>
			</main>
		<jsp:include page="/WEB-INF/jsp/Footer.jsp"></jsp:include>
		</div>
</body>
</html>